package com.example.springbootjwtexample.utils;

import org.apache.commons.lang3.RandomStringUtils;

import java.util.LinkedHashMap;
import java.util.Map;

public class AgentComponent {
    public static final String AGENT_KEY = "c909a2a828ececa94d97f68de98321a9";
    public static final String AGENT_ID = "jnzhnbhxayz";
    public static Map<String,Object> getHeaderMap(){
        LinkedHashMap<String,Object> headMap = new LinkedHashMap<>();
        headMap.put("v","a1");
        headMap.put("aid",AGENT_ID);
        String nonce = RandomStringUtils.randomNumeric(16);
        headMap.put("nonce",nonce);
        headMap.put("alg","HS256");
        headMap.put("timestamp",String.valueOf(System.currentTimeMillis() / 1000));
        return headMap;
    }
}
